#pragma once
#include <stdexcept>

// 定义IOException输入输出异常类
class IOException : public std::runtime_error {
public:
    explicit IOException(const std::string& what_arg)
        : std::runtime_error(what_arg) {}
};

// 定义MemException内存异常类
class MemException : public std::runtime_error {
public:
    explicit MemException(const std::string& what_arg)
        : std::runtime_error(what_arg) {}
};

// 定义LexException词法分析异常类
class LexException : public std::runtime_error {
public:
    explicit LexException(const std::string& what_arg)
        : std::runtime_error(what_arg) {}
};

// 定义CompileException编译异常类
class CompileException : public std::runtime_error {
public:
    explicit CompileException(const std::string& what_arg)
        : std::runtime_error(what_arg) {}
};

// 定义RuntimeException运行时异常类
class RuntimeException : public std::runtime_error {
public:
    explicit RuntimeException(const std::string& what_arg)
        : std::runtime_error(what_arg) {}
};